Add presence validation

Daniel O'Connor 10 years ago
parent
commit
2ec6c618d8
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/models/agents/mqtt_agent.rb

+ 4 - 4
app/models/agents/mqtt_agent.rb

@@ -67,10 +67,10 @@ module Agents
67 67
     MD
68 68
 
69 69
     def validate_options
70
-      # unless options['uid'].present? &&
71
-      #   options['expected_update_period_in_days'].present?
72
-      #   errors.add(:base, "expected_update_period_in_days and uid are required")
73
-      # end
70
+      unless options['uri'].present? &&
71
+        options['topic'].present?
72
+        errors.add(:base, "topic and uri are required")
73
+      end
74 74
     end
75 75
 
76 76
     def working?